<?php
	require_once "dBConnect.php";
	
	$db = new dBConnect();
	$query = $_GET['qname'];
	$mail = $_POST['mail'];
	if($query != ""){
		$conditions = "firstname like '$query%' or lastname like '$query%'";
	}else if($mail != ""){
		$conditions = "email like '$mail%'";
	}
	$user_resp = $db->getData("*", "users", $conditions);
	$rtn = "";
	
	foreach($user_resp as $member){
		$rtn .= $member['firstname']." ".$member['lastname']."|".$member['email']."\n"; 
	}
	
	echo $rtn;
?>